namespace hao_Common.Http.Options
{
    /// <summary>
    /// HTTP客户端配置选项
    /// </summary>
    public class HttpClientOptions
    {
        /// <summary>
        /// 配置节名称
        /// </summary>
        public const string SectionName = "HttpClient";

        /// <summary>
        /// 请求超时时间（秒）
        /// 默认30秒
        /// </summary>
        public int TimeoutSeconds { get; set; } = 30;

        /// <summary>
        /// 重试次数
        /// 默认3次
        /// </summary>
        public int RetryCount { get; set; } = 3;

        /// <summary>
        /// 重试间隔（毫秒）
        /// 默认1000毫秒
        /// </summary>
        public int RetryDelayMilliseconds { get; set; } = 1000;

        /// <summary>
        /// 熔断器失败阈值
        /// 默认5次失败后熔断
        /// </summary>
        public int CircuitBreakerFailureThreshold { get; set; } = 5;

        /// <summary>
        /// 熔断器持续时间（秒）
        /// 默认30秒
        /// </summary>
        public int CircuitBreakerDurationSeconds { get; set; } = 30;

        /// <summary>
        /// 是否启用详细日志
        /// 默认false
        /// </summary>
        public bool EnableDetailedLogging { get; set; } = false;

        /// <summary>
        /// 默认请求头
        /// </summary>
        public Dictionary<string, string> DefaultHeaders { get; set; } = new();
    }
}